using System.Collections.Generic;
using System.Data.Linq;
using Magiq.Databases;
using Magiq.Support;

namespace Magiq.Sql.Insert
{
    public class InsertTable<TNew> : DatabaseOperation, IInsertDestination<TNew> {
        private readonly ITable table;

        public InsertTable(ITable table, IDatabaseAdapter databaseAdapter)
        {
            DatabaseAdapter = databaseAdapter;
            this.table = table;
        }

        public void Insert(IEnumerable<TNew> items) {
            table.InsertAllOnSubmit(items);
        }
    }
}